﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;

#endregion

namespace SHFastShipRef
{
	[Serializable]
	public partial class SHFastShipRefModel : UIModel
	{
		#region Constructor
		public SHFastShipRefModel() : base("SHFastShipRef")
		{
			InitClass();
			this.SetResourceInfo("7a5b4871-7469-400c-ac17-07a72166c109");
            try{
			    AfterInitModel();
            }catch(Exception exception){
              IUIModel model = this;
		      this.ErrorMessage.SetErrorMessage(ref model,exception);
			}
		}

		//just for Clone 
		private SHFastShipRefModel(bool isInit) : base("SHFastShipRef")
		{}
		protected override IUIModel CreateCloneInstance()
		{
			return new SHFastShipRefModel(false);
		}
		#endregion
		#region member
		#region views
		private cRefView viewcRef;			
		#endregion
		
		#region links
		#endregion
		
		#region properties
		#endregion
		#endregion

		#region property
		public cRefView cRef
		{
			get { return (cRefView)this["cRef"]; }
		}
		
		#region RealViews
		#endregion
		
	
		#endregion

		#region function
		private void InitClass()
		{
			this.viewcRef = new cRefView(this);
			this.viewcRef.SetResourceInfo("1be773f7-09f1-4f6e-ba15-9047a97ba098");
			this.Views.Add(this.viewcRef);			

			
		}

		public override string AssemblyName
		{
			get { return "UFIDA.U9.Cust.SH.SHFastShipUI"; }
		}
		
		#endregion
		private void OnValidate_DefualtImpl()
    {
    }

	}


	[Serializable]
	public partial class cRefView : UIView
	{
		#region Constructor
		public cRefView(IUIModel model) : base(model,"cRef","UFIDA.U9.Cust.SH.SHFastShipBE.SHFastShip", true)
		{
			InitClass();
		}
		//构造空实例,不进行初始化.目前为Clone使用.
		private cRefView():base(null,"cRef","UFIDA.U9.Cust.SH.SHFastShipBE.SHFastShip", true)
		{
		}
		protected override IUIView CreateCloneInstance()
		{
			return new cRefView();
		}
		#endregion

		#region fiels property filter
		public IUIField FieldID
		{
			get { return this.Fields["ID"]; }
		}
		public IUIField FieldDocNo
		{
			get { return this.Fields["DocNo"]; }
		}
		public IUIField FieldShipDocNo
		{
			get { return this.Fields["ShipDocNo"]; }
		}
		public IUIField FieldDocDate
		{
			get { return this.Fields["DocDate"]; }
		}
		public IUIField FieldCustomer_Name
		{
			get { return this.Fields["Customer_Name"]; }
		}
		public IUIField FieldSaleType_Name
		{
			get { return this.Fields["SaleType_Name"]; }
		}
		public IUIField FieldDocState
		{
			get { return this.Fields["DocState"]; }
		}
		public IUIField FieldOrg_Name
		{
			get { return this.Fields["Org_Name"]; }
		}
		public IUIField FieldWH_Name
		{
			get { return this.Fields["WH_Name"]; }
		}


		[Obsolete("请使用CurrentFilter属性，这个方法有可能会导致强弱类型转换出错")]
		public cRefDefaultFilterFilter DefaultFilter
		{
			get { return (cRefDefaultFilterFilter)this.CurrentFilter; }
		}
		#endregion

		#region Init
		private void InitClass()
		{
			UIModelRuntimeFactory.AddNewUIField(this,"ID", typeof(Int64), false,"","System.Int64", "ID", true,true, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","2c36b6dc-f66e-44b2-8487-ecaa303da1d0");
			UIModelRuntimeFactory.AddNewUIField(this,"DocNo", typeof(String), false,"","System.String", "DocNo", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","c952d59c-70b0-4ee5-829f-057047520df6");
			UIModelRuntimeFactory.AddNewUIField(this,"ShipDocNo", typeof(String), true,"","System.String", "ShipDocNo", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","612398b2-2b1d-4b04-9d40-1b315946e4b7");
			UIModelRuntimeFactory.AddNewUIField(this,"DocDate", typeof(DateTime), false,"","System.DateTime", "DocDate", true,true, false, "",false,(UIFieldType)1,"3834a958-120f-4ac9-8d60-1a7be6d3f12f","d3c776ff-886a-4dbe-9a19-c4742f0d947b");
			UIModelRuntimeFactory.AddNewUIField(this,"Customer_Name", typeof(String), true,"","System.String", "Customer.Name", false,true, false, "",true,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","fabaf82d-04d2-4a5f-ac20-4b1a95276c7e");
			UIModelRuntimeFactory.AddNewUIField(this,"SaleType_Name", typeof(String), true,"","System.String", "SaleType.Name", false,true, false, "",true,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","f5a6e3aa-9e2c-496e-af2b-a237cca8a1c5");
			UIModelRuntimeFactory.AddNewUIField(this,"DocState", typeof(Int32), true,"","UFIDA.U9.Cust.SH.SHFastShipBE.FastShipDocState", "DocState", true,true, false, "",false,(UIFieldType)2,"643f41df-f9c1-4f26-844a-fd34ffbe7311","141cd99e-f0e1-4dc0-aa99-766d37463bec");
			UIModelRuntimeFactory.AddNewUIField(this,"Org_Name", typeof(String), true,"","System.String", "Org.Name", false,true, false, "",true,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","ea73f168-c3a5-40d5-8063-b661ff8bc85c");
			UIModelRuntimeFactory.AddNewUIField(this,"WH_Name", typeof(String), true,"","System.String", "WH.Name", false,true, false, "",true,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","b8ebefa7-a72e-476f-b680-5d2cd74f702e");


			this.CurrentFilter = new cRefDefaultFilterFilter(this);
		}
		#endregion
		
		#region override method
		protected override IUIRecord BuildNewRecord(IUIRecordBuilder builder)
		{
			return new cRefRecord(builder);
		}
		#endregion

		#region new method
		public new cRefRecord FocusedRecord
		{
			get { return (cRefRecord)base.FocusedRecord ; }
			set { base.FocusedRecord = value ; }
		}
		public new cRefRecord AddNewUIRecord()
		{	
			return (cRefRecord)base.AddNewUIRecord();
		}
		public new cRefRecord NewUIRecord()
		{	
			return (cRefRecord)base.NewUIRecord();
		}
		#endregion 

	}

	[Serializable]
	public class cRefRecord : UIRecord
	{
		#region Constructor
		public cRefRecord(IUIRecordBuilder builder):base(builder)
		{
		}
		private cRefView uiviewcRef
		{
			get { return (cRefView)this.ContainerView; }
		}
		protected override IUIRecord CreateCloneInstance(IUIRecordBuilder builder)
		{
			return new cRefRecord(builder);
		}
		#endregion

		#region property
		
		
		public  Int64 ID
		{
			get{
				//object value = this[this.uiviewcRef.FieldID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewcRef.FieldID);
			}
			set{
				this[this.uiviewcRef.FieldID] = value;
			}
		}
		
		
		public  String DocNo
		{
			get{
				//object value = this[this.uiviewcRef.FieldDocNo] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldDocNo);
			}
			set{
				this[this.uiviewcRef.FieldDocNo] = value;
			}
		}
		
		
		public  String ShipDocNo
		{
			get{
				//object value = this[this.uiviewcRef.FieldShipDocNo] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldShipDocNo);
			}
			set{
				this[this.uiviewcRef.FieldShipDocNo] = value;
			}
		}
		
		
		public  DateTime DocDate
		{
			get{
				//object value = this[this.uiviewcRef.FieldDocDate] ;
				//return (DateTime)value;
				return GetValue<DateTime>(this.uiviewcRef.FieldDocDate);
			}
			set{
				this[this.uiviewcRef.FieldDocDate] = value;
			}
		}
		
		
		public  String Customer_Name
		{
			get{
				//object value = this[this.uiviewcRef.FieldCustomer_Name] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldCustomer_Name);
			}
			set{
				this[this.uiviewcRef.FieldCustomer_Name] = value;
			}
		}
		
		
		public  String SaleType_Name
		{
			get{
				//object value = this[this.uiviewcRef.FieldSaleType_Name] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldSaleType_Name);
			}
			set{
				this[this.uiviewcRef.FieldSaleType_Name] = value;
			}
		}
		
		
		public  Int32? DocState
		{
			get{
				//object value = this[this.uiviewcRef.FieldDocState] ;
				//return (Int32?)value;
				return GetValue<Int32?>(this.uiviewcRef.FieldDocState);
			}
			set{
				this[this.uiviewcRef.FieldDocState] = value;
			}
		}
		
		
		public  String Org_Name
		{
			get{
				//object value = this[this.uiviewcRef.FieldOrg_Name] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldOrg_Name);
			}
			set{
				this[this.uiviewcRef.FieldOrg_Name] = value;
			}
		}
		
		
		public  String WH_Name
		{
			get{
				//object value = this[this.uiviewcRef.FieldWH_Name] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldWH_Name);
			}
			set{
				this[this.uiviewcRef.FieldWH_Name] = value;
			}
		}
		#endregion
	}
	
	[Serializable]
	public class cRefDefaultFilterFilter : UIFilter
	{
		#region Constructor
		public cRefDefaultFilterFilter(IUIView view) 
			: base("DefaultFilter",view,@"Org=#Context.OrgID#",@"")
		{
			InitClass();
		}
		//for Clone Constructor
		private cRefDefaultFilterFilter()
			: base("DefaultFilter",null,"","")
		{}
		protected override IUIFilter CreateCloneInstance()
		{
			return new cRefDefaultFilterFilter();
		}
		#endregion

		#region property
		#endregion
		
		#region function
		private void InitClass()
		{
		}
		#endregion

	}



}